#include "tools.h"


class Solution {
public:
    bool isCompleteTree(TreeNode* root) {
        queue<TreeNode*> q;
        q.push(root);

        while(!q.empty()){
            TreeNode* node = q.front();
            q.pop();
            if(node == nullptr) break;

            q.push(node->left);
            q.push(node->right);
        }

        while(!q.empty()){
            TreeNode* node = q.front();
            q.pop();
            if(node != nullptr) return false;
        }
        return true;

    }
};


int main(int argc, char const *argv[])
{
    vector<int> arr = {1,2,3,4,5,6};
    TreeNode* tree = create_tree(arr);
    showTree(tree);
    
    return 0;
}
